<include file="Public:header" />


<div class="outside users">
    <div class="inner">

        <!-- 右边侧栏 -->
        <include file="Public:sidenav" />


        <!-- 教育经历 -->
        <div class="user_inner">

            <div class="page_title icons_user">培训经历</div>
            <table width="100%"  cellpadding="1" cellspacing="1" style="border: 1px solid #ccc;">
                <tbody>
                <tr style="background:#f3f3f3;border-bottom: 1px solid #ccc;">
                    <td style="border-right:1px solid #ccc;" align="center">时间</td>
                    <td style="border-right:1px solid #ccc;" align="center">培训课程</td>
                    <td style="border-right:1px solid #ccc;" align="center">培训机构</td>
                    <td style="border-right:1px solid #ccc;" align="center">证书</td>
                    <td align="center">操作</td>
                </tr>
                <volist name="edu_trainnings" id="vo">
                    <tr style="border-bottom: 1px solid #ccc;" id="{$vo.train_id}">
                        <td width="20%" align="center">{$vo.start}-{$vo.end}</td>
                        <td width="20%" align="center">{$vo.train_name}</td>
                        <td width="20%" align="center">{$vo.subject}</td>
                        <td width="20%" align="center">{$vo.memo}</td>
                        <td width="20%" align="center"><a href="javascript:editEdu({$vo.train_id})">编辑</a>/<a href="javascript:delEdu({$vo.train_id})">删除</a></td>
                    </tr>
                </volist>
                </tbody>
            </table>

            <form id="form_add" name="form1" method="post" action="__URL__add_train_exper" class="form-validate">
                <table width="100%" >
                    <tr>
                        <td width="25%" align="right">
                            <font class="red">*</font>
                            时间：
                        </td>
                        <td>
                            <select name="start_year">
                                <?php for($i=date('Y')-50;$i<=date('Y');$i++){?>
                                <option value="<?php echo $i;?>" <?php if($i==date('Y')-10)echo " selected";?>><?php echo $i;?></option>
                                <?php }?>
                            </select>
                            年
                            <select name="start_month">
                                <?php for($i=1;$i<=12;$i++){?>
                                <option value="<?php echo sprintf('%02s',$i);?>"><?php echo sprintf('%02s',$i);?></option>
                                <?php }?>
                            </select>
                            月
                            至
                            <select name="end_year">
                                <?php for($i=date('Y')-50;$i<=date('Y');$i++){?>
                                <option value="<?php echo $i;?>" <?php if($i==date('Y')-10)echo " selected";?>><?php echo $i;?></option>
                                <?php }?>
                            </select>
                            年
                            <select name="end_month">
                                <?php for($i=1;$i<=12;$i++){?>
                                <option value="<?php echo sprintf('%02s',$i);?>"><?php echo sprintf('%02s',$i);?></option>
                                <?php }?>
                            </select>
                            月
                        </td>
                    </tr>
                    <tr>
                        <td width="25%" align="right">
                            <font class="red">*</font>
                            培训课程：
                        </td>
                        <td>
                            <input class="form-control required" type="text" name="train_name" id="train_name" />
                        </td>
                    </tr>
                    <tr>
                        <td width="25%" align="right">
                            <font class="red">*</font>
                            培训机构：
                        </td>
                        <td>
                            <input class="form-control required" type="text" name="subject" id="subject" />
                        </td>
                    </tr>
                    <tr>
                        <td width="25%" align="right">
                            <font class="red">*</font>
                            证书：
                        </td>
                        <td>
                            <input class="form-control" type="text" name="memo" id="memo" />
                        </td>
                    </tr>

                </table>
                <p align="center">
                    <input type="submit" class="submit" name="Submit" value="提交" />
                </p>
            </form>

        </div>
        <!-- /教育经历 -->
    </div>
</div>
<script src="/Public/js/jquery.validate.min.js"></script>
<script language="javascript">
    jQuery.extend(jQuery.validator.messages, {
        required: "必选字段",
        remote: "请修正该字段",
        email: "请输入正确格式的电子邮件",
        url: "请输入合法的网址",
        date: "请输入合法的日期",
        dateISO: "请输入合法的日期 (ISO).",
        number: "请输入合法的数字",
        digits: "只能输入整数",
        creditcard: "请输入合法的信用卡号",
        equalTo: "请再次输入相同的值",
        accept: "请输入拥有合法后缀名的字符串",
        maxlength: jQuery.validator.format("请输入一个 长度最多是 {0} 的字符串"),
        minlength: jQuery.validator.format("请输入一个 长度最少是 {0} 的字符串"),
        rangelength: jQuery.validator.format("请输入 一个长度介于 {0} 和 {1} 之间的字符串"),
        range: jQuery.validator.format("请输入一个介于 {0} 和 {1} 之间的值"),
        max: jQuery.validator.format("请输入一个最大为{0} 的值"),
        min: jQuery.validator.format("请输入一个最小为{0} 的值")
    });
    $(".form-validate").validate({
        errorPlacement: function(error, element)
        {
            error.insertAfter(element);
        }
    });

    function delEdu(id){
        if(confirm('确认要删除这一条数据吗')){
            $.ajax({url:'__URL__del_trainning',
                type:'POST',
                data:'train_id='+id,
                dataType:'html',
                success:function(data){
                    window.location.reload();
                }
            });
        }
    }

    function editEdu(id){
        window.location.href = "__URL__user_train_edit/id/"+id;
    }
</script>

<include file="Public:footer" />

